package com.example.demo.service;

import com.example.demo.mapper.BlogMapper;
import com.example.demo.model.Blog;
import com.example.demo.model.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class BlogService {
    @Resource
    public BlogMapper blogMapper;

    public List<Blog> getAllBlog() {
        return blogMapper.getAllBlog();
    }

    public Blog getBlogByBid(Integer blogId) {
        return blogMapper.getBlogByBid(blogId);
    }

    public void createOneBlog(Blog blog) {
        blogMapper.createOneBlog(blog);
    }

    public void deleteByBId(String blogId) {
        blogMapper.deleteByBId(blogId);
    }

    public void updateBlog(Blog blog) {
        blogMapper.updateBlog(blog);
    }

    public List<Blog> getAllBlogById(Integer userId) {
        return blogMapper.getAllBlogById(userId);
    }
}
